#import "BWPannerWindowController.h"
#import "BWGraphDocument.h"
#import "BWPannerView.h"

static BWPannerWindowController *g_controller;

@implementation BWPannerWindowController

- (void) setDocument: (NSDocument *) document
{
    [super setDocument: document];

    NSScrollView *view;
    view = [document valueForKey: @"layerViewScrollView"];

    [pannerView setScrollView: view];

    if (document == nil) {
        [[self window] setTitle: @"Overview Inspector"];
    }

} // setDocument


- (NSString *) windowTitleForDocumentDisplayName: (NSString *) displayName
{
    NSString *string;

    string = [NSString stringWithFormat: @"Overview of %@", displayName];
    return (string);

} // windowTitleForDocumentDisplayName



+ (NSString *) autosaveName
{
    return (@"pannerWindow");
} // autosaveName


+ (BWWindowController *) sharedInstance
{
    return (g_controller);
} // sharedInstance


+ (void) setSharedInstance: (BWWindowController *) controller
{
    assert ([[controller class] isSubclassOfClass: self]);

    g_controller = (BWPannerWindowController *)controller;

} // setShraedInstance


+ (NSString *) windowNibName
{
    return (@"BWPannerWindow");
} // windowNibName

@end // BWPannerWindowController

